<template>
	<view>
		<uni-number-box :min="0" :max="1000000" :value="localValue" @change="onChange"></uni-number-box>
	</view>
</template>

<script>
	export default {
		props: {
			value: [String, Number],
			default: null,
			field: Object,
			isEdit: Boolean,
		},
		data() {
			return {

			}
		},
		
		data() {
			return {
				localValue: this.value // 初始化本地副本
			}
		},
		
		watch: {
			value(newVal) {
				this.localValue = newVal // 当prop变化时更新本地值
			}
		},
		
		methods: {
			onChange(e) {
				this.$emit('update-value', e.target.value); // 触发事件
			}
		}
	}
</script>

<style>

</style>